import Vue from 'vue'
import Router from 'vue-router'
import Cashier from '@/pages/cashier'
import orderSettlement from '@/pages/orderSettlement'
import Detail from '@/pages/detail'
import teaRoom from '@/pages/teaRoom'

import VueAwesomeSwiper from 'vue-awesome-swiper'
import 'swiper/dist/css/swiper.css'

Vue.use(VueAwesomeSwiper) 
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/cashier',
      name: 'Cashier',
      component: Cashier,
      meta:{
        title:'订单支付'
      }
    },
    {
      path: '/order',
      name: 'orderSettlement',
      component: orderSettlement,
      meta:{
        title:'订单详情'
      }
    },
    {
      path: '/detail',
      name: 'Detail',
      component: Detail,
      beforeEnter: (to, from, next) => {
        // ...
        window.title = '预定茶室';
        next();
      },
      // meta:{
      //   title:'茶室预定'
      // }
    },
    {
      path: '/',
      name: 'teaRoom',
      component: teaRoom,
      meta:{
        title:'倒茶'
      }
    }
  ]
})
